package com.txzt.gaea.common.enums;

public enum PurchaseStatus {

    /**
     * 已登记
     */
    RECORD(0,"已登记"),
    /**
     * 采购中
     */
    PURCHASING(1,"采购中"),
    /**
     * 已采购
     */
    PURCHASED(2,"已采购"),
    ;

    private final Integer code;

    private final String info;

    PurchaseStatus(Integer code, String info) {
        this.code = code;
        this.info = info;
    }

    public Integer getCode() {
        return code;
    }

    public String getInfo() {
        return info;
    }

    public static String getInfoByCode(Integer code){
        PurchaseStatus[] statuses = values();
        for (PurchaseStatus status:statuses){
            if (status.getCode().equals(code)) {
                return status.getInfo();
            }
        }
        return "";
    }
}
